#include "stdafx.h"

using namespace std;

typedef int(*ADD)(int a, int b);
typedef int(*SUB)(int a, int b);

int main()
{
	HINSTANCE__* hMODULE = LoadLibraryW(L"dll.dll");
	if(!hMODULE){
		cout<<"Error!!!";
	}

	ADD Add;
	SUB Sub;

	Add = (ADD)GetProcAddress(hMODULE, "Add");
	Sub = (SUB)GetProcAddress(hMODULE, "Sub");

	int Result = 0;
	Result = Add(10, 5);
	cout<<"Excute Add(10, 5) and return: "<<Result<<endl;
	Result = Sub(10, 5);
	cout<<"Excute Sub(10, 5) and return: "<<Result<<endl;

	return 0;
}